var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
o.modRegisterInit = o.modRegister = void 0;
var n = new ((function () {
    function e() {
        this.modInfo = {};
        this.initArr = [];
    }
    e.prototype.registerInit = function (e, t) {
        this.initArr.push(e);
        this.register(e, t);
    };
    e.prototype.register = function (e, t) {
        this.modInfo[e] = t;
    };
    e.prototype.init = function () {
        for (var e = 0; e < this.initArr.length; e++) {
            var t = this.initArr[e],
                o = this.modInfo[t];
            o && o.instance;
        }
    };
    e.prototype.getMod = function (e) {
        return this.modInfo[e];
    };
    e.prototype.getModInstance = function (e) {
        var t = this.getMod(e);
        return (t && t.instance) || t;
    };
    e.prototype.getModKeys = function () {
        return Object.keys(this.modInfo);
    };
    return e;
})())();
o.default = n;
o.modRegister = function (e) {
    return function (t) {
        n.register(e || t.modName || t.prototype.modName || cc.js.getClassName(t), t);
    };
};
o.modRegisterInit = function (e) {
    return function (t) {
        n.registerInit(e || t.modName || t.prototype.modName || cc.js.getClassName(t), t);
    };
};
